
import Vue from 'vue';
import cameCase from 'lodash/camelCase';
import upperFirst from 'lodash/upperFirst';
const requireComponent = require.context('./',true,/\.vue$/);

requireComponent.keys().forEach(fileName => {
    console.log(fileName);

    const  componentConfig = requireComponent(fileName);

    const componentName =upperFirst(cameCase(fileName.replace(/(\.\/|\index.vue)/g,'')));
    console.log(componentName);
    

    Vue.component(componentName,componentConfig.default||componentConfig);
});
